import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:industry_net/base/common/util.dart';
import 'package:industry_net/pages/news/main/models/news.dart';
import 'package:industry_net/pages/news/main/views/content/controller.dart';

class NewsCell extends StatelessWidget {
  NewsCell({Key? key, required this.md}) : super(key: key);
  final NewsModel md;
  final controller = Get.find<ContentController>();
  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () => controller.actionCellClick(md),
      child: Container(
        height: 90.r,
        padding: EdgeInsets.symmetric(horizontal: gap12, vertical: gap10),
        child: Row(
          children: [
            Expanded(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    '农业农村部：我为农民办实事，高素质农民专项信贷服务来了',
                    style: pfSCStyle(color: ColorsUtil.title, fontSize: font15),
                  ),
                  Row(
                    children: [
                      Text(
                        '央广网',
                        style: pfMediumStyle(
                            color: ColorsUtil.content, fontSize: font12),
                      ),
                      SizedBox(
                        width: gap10,
                      ),
                      Text(
                        md.createTimeStr,
                        style: pfMediumStyle(
                            color: ColorsUtil.content, fontSize: font12),
                      ),
                      SizedBox(
                        width: gap10,
                      ),
                      Text(
                        '9999次浏览',
                        style: pfMediumStyle(
                            color: ColorsUtil.content, fontSize: font12),
                      ),
                    ],
                  )
                ],
              ),
            ),
            SizedBox(
              width: 5.r,
            ),
            ClipRRect(
              borderRadius: BorderRadius.circular(circle4),
              child: loadImage(
                width: 110.r,
                height: 70.r,
              ),
            )
          ],
        ),
      ),
    );
  }
}
